<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<title>demo</title>
<meta charset="UTF-8" />
<link rel="stylesheet" type="text/css" href="css/login.css">
<link rel="stylesheet" type="text/css"
	href="easyui/1.3.4/themes/default/easyui.css" />
<link rel="stylesheet" type="text/css" href="css/wu.css" />
<link rel="stylesheet" type="text/css"
	href="font-awesome-4.7.0/css/font-awesome.css" />
<link rel="stylesheet" type="text/css" href="css/icon.css" />
<script type="text/javascript" src="js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="easyui/1.3.4/jquery.easyui.min.js"></script>
<script type="text/javascript"
	src="easyui/1.3.4/locale/easyui-lang-zh_CN.js"></script>
</head>

<body>
	<div class="wrapper">
		<div class="container">
			<h1>设备后台管理系统</h1>
			<form class="form" action="" method="post" onsubmit="return sub()">
				<input type="text" placeholder="请输入用户名" id="passport"
					name="passport" required="required"> <input type="password"
					placeholder="请输入密码" id="password" name="password"
					required="required">
				<button type="submit" id="login-button">登录</button>
			</form>
		</div>

		<ul class="bg-bubbles">
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
		</ul>
	</div>
</body>
<script type="text/javascript">
	//登录提交
	function sub() {
		var passport = $("#passport").val();
		var password = $("#password").val();
		$.ajax({
			type : "POST",
			url : "/demo/user/login",
			data : {
				"passport" : passport,
				"password" : password
			},
			success : function(data) {
				if (data.code == 0) {
					window.location.href = "index.jsp"
				} else {
					$.messager.show({
						title : "信息提示",
						msg : '登录失败' + data.msg,
						showType : 'fade',
						width : 260,
						height : 140,
						timeout : 5000
					});
				}
			}
		});
		return false;
	}
</script>
</html>